/*! \file classtype.h
	\author HiddenSeeker
	
	Describes a class type node, which inherits a declaration of class (inner)
*/
#include "list.h"
#include "identifierstring.h"
#include <vector>
#include <string>
#pragma once
/*! \class ClassType
    Type class node
*/
class ClassTypeNode: public AbstractNode
{
 private:
	      std::string              * m_name;
		  ListNode<IdentifierNode> * m_template_args;
 public:
	     inline ClassTypeNode(const YYLTYPE & pos, std::string * data):AbstractNode(pos)
	     {
			 m_name=data;
			 m_template_args=NULL;
		 }
		 inline const std::string & getTA(unsigned int arg) 
		 { 
			 if (m_template_args)
				 return  m_template_args->vector()[arg]->data();
			 else return *(new std::string()); 
		 }
		 /*! Template args
		  */
		 inline void setArgs( ListNode<IdentifierNode> * args)
		 {
			 m_template_args=args;
		 }
		 /*! Returns full name of type
		 */
		 std::string fullName() const; 
		 /*! Partial name of tpe
		 */
		 inline const std::string & partialName() const {return *m_name;} 
		 /*! Whether template args amount is current
		  */
		 inline bool isTAAmount(int amount) { if (!m_template_args) return amount==0; return m_template_args->vector().size()==amount; }
		 /*! Returns template args count
		  */
		 inline unsigned int TAACount() { if (!m_template_args) return 0; return m_template_args->vector().size();}
		 /*! Writes a node data to stream
		  */
		 void write(GraphStream * s);
		 /*! Returns a simple signature data
		  */
		 std::string getSimpleSignature() const;
		 /*! Returns a full signature data
		  */
		 std::string getFullSignature() const;
		 inline ~ClassTypeNode()
		 {
			 if (this->isOwningData())
			 {
				 delete m_name;
				 delete m_template_args;
			 }
		 }
};
